import http from "@/api/axios";

export const getListApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/bizPreOrderShipment/manager/selectBypage",
    data
  });
};
//获取业务运单分页
export const geBusinesstListApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/bizPreOrderShipment/manager/selectBusinessBypage",
    data
  });
};

// 获取运单标签页 各状态 数量
export const getBusinessPageStaticApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/bizPreOrderShipment/selectBusinessPreOrderShipmentCountWarehousing",
    data
  });
};

// 批量更新运单的 客户备注、内部备注
export const batchUpdateRemarkApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/bizPreOrderShipment/updatePreOrderShipmentRemarkByIdList",
    data
  });
};
// 获取标签页 各状态 数量
export const getPageStaticApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/bizPreOrderShipment/selectPreOrderShipmentCountWarehousing",
    data
  });
};
// 运单列表 添加移除标识
export const changeWaybillMarkApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/bizPreOrderShipment/updatePreOrderShipmentMarkByShipId",
    data
  });
};
// 修改件数
export const modifyItemNumberApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/bizPreOrderShipment/updateItemNumber",
    data
  });
};

// 取消运单
export const cancelBatchOrderShipmentApi = (data: string[]) => {
  return http({
    method: "post",
    url: "/base/biz/bizPreOrderShipment/cancelBatchOrderShipment",
    data: data
  });
};

// 导出模版 - 根据id 查询详细信息
export const exportTemplateApi = (id: string) => {
  return http({
    method: "get",
    url: `/export/biz/exportTemplate/get/${id}`
  });
};

// 使用模版导出
export const createTemplateFileApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `/export/biz/exportTemplate/createTemplateFile`,
    data
  });
};

// 自定义模版导出
export const customizeImportApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `/export/biz/exportTemplate/customizeImport`,
    data
  });
};

// 统计
export const statisticsDataApi = (data: CustomerServiceWaybill.SearchForm) => {
  return http({
    method: "post",
    url: `/base/biz/bizPreOrderShipment/manager/getPreOrderShipmentEsStatisticsRes`,
    data
  });
};
//运单日志
export const listByBusinessIdApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `/base/biz/bizOperateLog/listByBusinessId`,
    data
  });
};
// 发票导出
export const InvoiceExportApi = (data: { bizExportTemplateId: string; shipmentIdList: Array<string> }) => {
  return http({
    method: "post",
    url: `/export/biz/exportTemplate/getInvoiceExportUrl`,
    data,
    responseType: "blob",
    headers: {
      enable: true
    }
  });
};
